﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DataStructuresCSharp.Node
{
    public class BinarySearchTreeNode<TKey, TValue> : BaseBinaryTreeNode<KeyValuePair<TKey, TValue>, BinarySearchTreeNode<TKey, TValue>>
    {
        public BinarySearchTreeNode<TKey, TValue> Parent
        {
            get { return Children[2]; }
            set { Children[2] = value; }
        }

        public BinarySearchTreeNode(TKey key, TValue value, BinarySearchTreeNode<TKey, TValue> left = null,
            BinarySearchTreeNode<TKey, TValue> right = null, BinarySearchTreeNode<TKey, TValue> parent = null)
            : this(new KeyValuePair<TKey, TValue>(key, value), left, right, parent)
        {

        }

        public BinarySearchTreeNode(KeyValuePair<TKey, TValue> item, BinarySearchTreeNode<TKey, TValue> left = null,
            BinarySearchTreeNode<TKey, TValue> right = null, BinarySearchTreeNode<TKey, TValue> parent = null)
        : base(3, item, left, right)
        {
            Parent = parent;
        }
    }
}
